package kr.co.medical.dao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

import kr.co.medical.dto.CalBean;
import kr.co.medical.dto.Cheobang_All;
import kr.co.medical.dto.Cheobang_Jupsoo;
import kr.co.medical.dto.Cheobangjeon;
import kr.co.medical.dto.Dept;
import kr.co.medical.dto.Disease;
import kr.co.medical.dto.Doctor;
import kr.co.medical.dto.DoctorMajor;
import kr.co.medical.dto.DoctorSchedule;
import kr.co.medical.dto.Jupsoo;
import kr.co.medical.dto.Medicine_Cheobang_Patient;
import kr.co.medical.dto.NoSoonap;
import kr.co.medical.dto.No_Soonap_Check;
import kr.co.medical.dto.Patient;
import kr.co.medical.dto.Soonap;
import kr.co.medical.dto.Ward;
import kr.co.medical.dto.WardMaster;

public interface OfficeDao {

	public int infoinsert(Patient patient) throws ClassNotFoundException,
			SQLException;

	public List<Dept> selectDept() throws ClassNotFoundException, SQLException;

	public Patient selectpatient2(String jupsoo_id) throws ClassNotFoundException, SQLException;
	
	public Patient selectofficeinfo(String name,String jumin1) throws ClassNotFoundException, SQLException;
	
	public List<DoctorSchedule> showschedule(String doctor_id) throws ClassNotFoundException, SQLException;	
	//해당 층에 대한 정보 찾기
	public List<Ward> selectFloor(int floor) throws ClassNotFoundException, SQLException;
	
	public Patient jubsoopatient(String patient_id) throws ClassNotFoundException, SQLException;
	
	public List<DoctorSchedule> selectday(String sdate,String doctor_id) throws ClassNotFoundException,SQLException;
	//처방 리스트
	public List<Cheobang_Jupsoo> cheobanglist() throws ClassNotFoundException, SQLException;
	//처방 검색
	public List<Cheobang_Jupsoo> cheobangcheck(HashMap<String, String> map) throws ClassNotFoundException, SQLException;
	
	public List<Cheobang_Jupsoo> cheobangcheck2(HashMap<String, String> map) throws ClassNotFoundException, SQLException;
	//처방 완료
	public Patient selectpatinfo(String NAME) throws ClassNotFoundException, SQLException;
	
	public List<CalBean> deptschedule(String url) throws ClassNotFoundException, SQLException;
	
	public int addschedule(DoctorSchedule doctorschedule) throws ClassNotFoundException, SQLException;
	
	public int delschedule(DoctorSchedule doctorschedule) throws ClassNotFoundException, SQLException;
	
	public List<Doctor> showdoctor() throws ClassNotFoundException, SQLException;
	
	public int addreser_v(Jupsoo jupsoo) throws ClassNotFoundException, SQLException;
	
	public int addreser_j(Jupsoo jupsoo) throws ClassNotFoundException, SQLException;
	
	public int addreser_j2(Jupsoo jupsoo) throws ClassNotFoundException, SQLException;
	
	public int addreser_j3(Jupsoo jupsoo);
	//처방 내역
	public List<Cheobang_All> cheobang_all(String JUPSOO_ID,String CHEOBANG_ID) throws ClassNotFoundException, SQLException;
	
	public List<Cheobang_All> cheobang_all2(String patient_id) throws ClassNotFoundException, SQLException;
	
	public Cheobang_All cheobang_all3(String cheobang_id) throws ClassNotFoundException, SQLException;
	//해당 침대에 환자 정보 찾기
	public List<WardMaster> wardPatientInfo(int ward_Num, int bed_Num) throws ClassNotFoundException, SQLException;
	
	//병실 정보 찾기
	public List<WardMaster> isEmpty() throws ClassNotFoundException, SQLException;


	public List<DoctorMajor> selectDoctor(String dept_id)
			throws ClassNotFoundException, SQLException;

	public Patient selectpatient(String name) throws ClassNotFoundException,
			SQLException;

	public List<DoctorSchedule> selectday2(String sdate, String doctor_id)
			throws ClassNotFoundException, SQLException;

	// 약처방 내역
	public List<Medicine_Cheobang_Patient> medic_cheobang_p(String CHEOBANG_ID)
			throws ClassNotFoundException, SQLException;

	// 복용법
	public List<Medicine_Cheobang_Patient> dose(String CHEOBANG_ID)
			throws ClassNotFoundException, SQLException;

	public String visitant(String patient_id) throws ClassNotFoundException,
			SQLException;

	public int addwaiting(String visitant_id) throws ClassNotFoundException,
			SQLException;

	// 수납 테이블 select
	public Soonap selectsoonap(String JUPSOO_ID, String CHEOBANG_ID)
			throws ClassNotFoundException, SQLException;

	// 수납 테이블 insert 추후에 doctor 에서 완료 누를 경우 수납테이블에 인서트 시켜야함
	public int insertsoonap(String CHEOBANG_ID, String JUPSOO_ID)
			throws ClassNotFoundException, SQLException;

	public String currentdate() throws ClassNotFoundException, SQLException;

	public int updateschedule(String schedule_id)
			throws ClassNotFoundException, SQLException;

	
	  //추후에 doctor 에서 완료 누를 경우 미수납 테이블에 인서트 시켜야 할 쿼리 
	  /*
	  INSERT INTO no_soonap
	  VALUES('no'||SEQ_NO_SOONAP.NEXTVAL, ( (SELECT NVL(SUM(price),0) FROM
	  examine_cheobang e JOIN fee f ON e.fee_id =f.fee_id WHERE
	  e.cheobang_temp_id='C70104')+ (SELECT NVL(SUM(fee*quantity),0) FROM
	  medicine_cheobang m JOIN medicine_n_medicine_cheobang mm ON
	  m.medicine_cheobang_id=mm.medicine_cheobang_id JOIN medicine medic ON
	  medic.medicine_id=mm.medicine_id WHERE cheobang_id='C70104')
	  
	  ) ,'soo5')
	  */
	 
	public Soonap selectno_soonap(String CHEOBANG_ID)
			throws ClassNotFoundException, SQLException;

	// 입원
	public int wardjupsoo(int ward_Num, int bed_Num, String patient_id,
			String jupsoo_id) throws ClassNotFoundException, SQLException;

	public int wardjupsoo_his(int ward_Num, int bed_Num, String patient_id,
			String jupsoo_id) throws ClassNotFoundException, SQLException;

	public int wsoonapinsert(String jupsoo_id) throws ClassNotFoundException,
			SQLException;

	public Jupsoo jupsoo_id(String patient_id) throws ClassNotFoundException,
			SQLException;

	public int updatefile(String filename) throws ClassNotFoundException,
			SQLException;
	
	public int jindanjupsooinsert(String is_personally, String is_document, String target,
			  String jumin1,String jumin2, String jindantype,
			  String jupsoo_id);
	
	public Jupsoo jupsoo_select(String jupsoo_id);
	
	public int cheobangwaiting_insert(String visitant_id, String jupsoo_time, String doctor_id,String jupsoo_id,String dept_id);

	public int cheobangwaiting_insert(String jupsoo_id2);
	
	public int soogainsert(String cheobang_id)  throws ClassNotFoundException,SQLException;

	
	public int ok_sg_price(int ok_sg_price) throws ClassNotFoundException,SQLException;
	

	public List<Cheobangjeon> select_medicine(String cheobang_id) throws ClassNotFoundException,SQLException;
	
	public Patient cheobang_patient(String cheobang_id) throws ClassNotFoundException,SQLException;
	
	public List<Disease> disease_select(String cheobang_id) throws ClassNotFoundException,SQLException;
	
	public List<NoSoonap> shownosoonapinfo(String patient_id) throws ClassNotFoundException,SQLException;

	public List<NoSoonap> showsoonapinfo(String patient_id) throws ClassNotFoundException,SQLException;
	
	public String total_nosoonap(String patient_id) throws ClassNotFoundException,SQLException;
	
	public No_Soonap_Check no_soonap_check(String cheobang_id) throws ClassNotFoundException,SQLException;
	
	public int soonap_completion (No_Soonap_Check no) throws ClassNotFoundException,SQLException;
	public int delete_no_soonap(No_Soonap_Check no) throws ClassNotFoundException,SQLException;
	
	//중간수납
	public int mid_insert(No_Soonap_Check no) throws ClassNotFoundException,SQLException;
	
	//노수납 업데이트
	public int update_nosoonap(No_Soonap_Check no) throws ClassNotFoundException,SQLException;
	
	//미드수납 지우기
	public int delete_mid(No_Soonap_Check no) throws ClassNotFoundException,SQLException;
	

	public List<NoSoonap> wardcheobanglist() throws ClassNotFoundException,SQLException;
	
	public List<NoSoonap>wardcheobangcheck2(HashMap<String, String> map) throws ClassNotFoundException,SQLException;
	
	public List<NoSoonap> wardcheobangcheck3(String name) throws ClassNotFoundException,SQLException;
	
	public NoSoonap wardnosoonap(String jupsoo_id) throws ClassNotFoundException,SQLException;
	
	public No_Soonap_Check wardnosoonap2(String jupsoo_id) throws ClassNotFoundException,SQLException;

	public List<DoctorSchedule> selecttime(String doctor_id, String res_time,String sdate) throws ClassNotFoundException,SQLException;

	public int doctor_insert(Doctor doctor) throws ClassNotFoundException,SQLException;
	
	public Doctor doctor_select (Doctor doctor) throws ClassNotFoundException,SQLException;
	
	public List<Doctor> dept_select() throws ClassNotFoundException,SQLException;
	
	public List<Doctor> dept_detail_select(String dept_id) throws ClassNotFoundException,SQLException;
	
	public int insert_major(String doctor_id,String dept_detail_id) throws ClassNotFoundException,SQLException;
	
	public int insert_doctor_info (String content,String start_year,String end_year,String doctor_id) throws ClassNotFoundException,SQLException;
	
	public int doctor_info_faile (String doctor_id) throws ClassNotFoundException,SQLException;
	
	public int major_faile(String doctor_id) throws ClassNotFoundException,SQLException;
	
	public int doctor_faile(String doctor_id) throws ClassNotFoundException,SQLException;

}
